/**
 * @(#)com.pattern.p_02_observer.order.Customer
 *
 * Copyright (c) 2014-2018 上海纬视瑞科技有限公司
 *
 * DESC:
 *
 */
package com.pattern.p_02_observer.order;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fusf
 * @version 1.0  2016/11/3
 */
public class Customer extends ISubject {
   private List<JobStation> jobStationList = new ArrayList<JobStation>();
   private String customState;

    public void attach(JobStation jobStation) {
        jobStationList.add(jobStation);
    }

    public void remove(JobStation jobStation) {
        jobStationList.remove(jobStation);
    }

    @Override
    public void notifyJobStation() {
        for(JobStation o : jobStationList) {
            o.update();
        }
    }

    public String getCustomState() {
        return customState;
    }

    public void setCustomState(String customState) {
        this.customState = customState;
    }
}
